/**
 * Data management in local storage
 */
var DataStorageManagement = function() {
    /**
     * The type l = localstorage
     *          c = cookie
     *          s = session
     */
    var type;
    
    this.create = function(the_sz_type) {
        this.type = the_sz_type;
    }
    
    this.store = function(the_sz_key, the_sz_value)  {
        //  Local storage
        if(this.type == "l") {
            localStorage.setItem(the_sz_key, the_sz_value);
        }
        
        //  Cookie
        if(this.type == "c") {
            jQuery.cookie(the_sz_key,the_sz_value);
        }
        
        //  Session
        if(this.type == "s") {
            
    }
    }
    
    this.getData = function(the_sz_key) {
        //  Local storage
        if(this.type == "l") {
            return localStorage.getItem(the_sz_key);
        }
        
        //  Cookie
        if(this.type == "c") {
            return jQuery.cookie(the_sz_key);
        }
        
        //  Session
        if(this.type == "s") {
            return false;
        }
        return false;
    }
	
    this.clear = function() {
        //  Local storage
        if(this.type == "l") {
            localStorage.clear();
        }
        
        //  Cookie
        if(this.type == "c") {
            jQuery.cookie(the_sz_key,null);
        }
        
        //  Session
        if(this.type == "s") {
            
    }
    }
    
    this.remove = function(the_sz_key) {
        //  Local storage
        if(this.type == "l") {
            localStorage.removeItem(the_sz_key);
        }
        
        //  Cookie
        if(this.type == "c") {
            jQuery.cookie(the_sz_key,null);
        }
        
        //  Session
        if(this.type == "s") {
            
    }
    }
}